/*
 * marketsim-eclipsetrader
 *
 * Copyright (C) 2008-2011 Steve Phelps and John Cartlidge
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 */
/*
 *  (C) Victria Ltd. 2007
 */
package victria.marketsim.eclipsetrader.perspective;

import net.sourceforge.eclipsetrader.core.ui.views.SecuritiesView;
import net.sourceforge.eclipsetrader.trading.views.Level2View;
import net.sourceforge.eclipsetrader.trading.views.OrdersView;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import victria.marketsim.eclipsetrader.view.ServerEventsView;

public class MarketSimPerspectiveFactory implements IPerspectiveFactory {

	public void createInitialLayout(IPageLayout layout) {

		layout.setEditorAreaVisible(false);

		layout.addShowViewShortcut("net.sourceforge.eclipsetrader.trading.trade");
		layout.addShowViewShortcut(OrdersView.VIEW_ID);
		layout.addShowViewShortcut(SecuritiesView.VIEW_ID);
		layout.addShowViewShortcut(ServerEventsView.VIEW_ID);

		IFolderLayout main = layout.createFolder("marketsim_center", IPageLayout.TOP,
				0f, IPageLayout.ID_EDITOR_AREA);

		IFolderLayout bottom = layout.createFolder("marketsim_bottom",
				IPageLayout.BOTTOM, (float) 0.70, "marketsim_center");
		IFolderLayout right = layout.createFolder("marketsim_right",
				IPageLayout.RIGHT, (float) 0.75, "marketsim_center");
		IFolderLayout left = layout.createFolder("marketsim_left", IPageLayout.LEFT,
				(float) 0.22, "marketsim_center");

		bottom.addView("net.sourceforge.eclipsetrader.trading.trade");
		right.addView(OrdersView.VIEW_ID);
		bottom.addPlaceholder(ServerEventsView.VIEW_ID);
		left.addView(SecuritiesView.VIEW_ID);
		main.addPlaceholder(Level2View.VIEW_ID + ":*");
	}
}
